﻿Imports System.IO
Imports System.IO.File
Imports CommonDLL.Common

Public Class ParameterSet

    Dim TextBox_High(30) As System.Windows.Forms.TextBox
    Dim TextBox_X轴(30) As System.Windows.Forms.TextBox
    Dim TextBox_Y轴(30) As System.Windows.Forms.TextBox
    Dim ComBox_XFS(30) As System.Windows.Forms.ComboBox
    Public i As Integer

    Private Sub ParameterSet_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
        FrmMain.OPC_RefreshData_Parameter()
    End Sub

    Private Sub ParameterSet_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        initControl()
        TextBox_PointCount.Text = CurScrewPara.PointCount
        TextBox_ScrewSN.Text = CurScrewPara.ScrewSN
        chanpin_TextBox.Text = Chanpin
        If CurScrewPara.Online_Mod = 1 Then
            No_online.Checked = True                            '单独一台
        ElseIf CurScrewPara.Online_Mod = 2 Then
            First_online.Checked = True                         '联机第一台
        ElseIf CurScrewPara.Online_Mod = 3 Then
            Mid_online.Checked = True                           '中间机台
        ElseIf CurScrewPara.Online_Mod = 4 Then
            End_online.Checked = True                           '最后一台
        End If
        'Load_ZaxisPls()

        If NumberOfPSetArray > 0 Then
            For i As Integer = 0 To NumberOfPSetArray - 1
                Select Case i + 1
                    Case 1
                        Pget1XPosCompensate.Text = Pget(i).XPosCompensate
                        Pget1YPosCompensate.Text = Pget(i).YPosCompensate
                        Pget1ZPosCompensate.Text = Pget(i).ZPosCompensate

                        Pset1XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset1YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset1ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset1RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 2
                        Pget2XPosCompensate.Text = Pget(i).XPosCompensate
                        Pget2YPosCompensate.Text = Pget(i).YPosCompensate
                        Pget2ZPosCompensate.Text = Pget(i).ZPosCompensate

                        Pset2XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset2YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset2ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset2RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 3
                        Pset3XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset3YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset3ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset3RPosCompensate.Text = Pset(i).RPosCompensate
                        XMin.Text = Pget(i).XPosCompensate 'X最小值
                        XMax.Text = Pget(i).YPosCompensate 'X最大值
                        Lenth.Text = Pget(i).ZPosCompensate '距离最大值
                    Case 4
                        Pset4XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset4YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset4ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset4RPosCompensate.Text = Pset(i).RPosCompensate
                        ADD_Screw_Count_Box.Text = Pget(i).XPosCompensate   '加螺丝报警次数
                        Retry_Times_box.Text = Pget(i).YPosCompensate
                        Clear_Time_Box.Text = Pget(i).ZPosCompensate
                    Case 5
                        Pget3XPosCompensate.Text = Pget(i).XPosCompensate
                        Pget3YPosCompensate.Text = Pget(i).YPosCompensate
                        Pget3ZPosCompensate.Text = Pget(i).ZPosCompensate
                        Pset5XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset5YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset5ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset5RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 6
                        Pget4XPosCompensate.Text = Pget(i).XPosCompensate
                        Pget4YPosCompensate.Text = Pget(i).YPosCompensate
                        Pget4ZPosCompensate.Text = Pget(i).ZPosCompensate
                        Pset6XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset6YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset6ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset6RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 7
                        Pset7XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset7YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset7ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset7RPosCompensate.Text = Pset(i).RPosCompensate
                        UploadDataNum.Text = Pget(i).ZPosCompensate
                        Photo_displacement.Text = Pget(i).YPosCompensate     '拍照点偏移-15
                        SNMN.Checked = Upload_enable                         '联机向下一台传送数据
                    Case 8
                        Pset8XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset8YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset8ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset8RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 9
                        Pset9XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset9YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset9ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset9RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 10
                        Pset10XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset10YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset10ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset10RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 11
                        Pset11XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset11YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset11ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset11RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 12
                        Pset12XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset12YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset12ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset12RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 13
                        Pset13XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset13YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset13ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset13RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 14
                        Pset14XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset14YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset14ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset14RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 15
                        Pset15XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset15YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset15ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset15RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 16
                        Pset16XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset16YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset16ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset16RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 17
                        Pset17XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset17YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset17ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset17RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 18
                        Pset18XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset18YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset18ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset18RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 19
                        Pset19XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset19YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset19ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset19RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 20
                        Pset20XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset20YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset20ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset20RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 21
                        Pset21XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset21YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset21ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset21RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 22
                        Pset22XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset22YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset22ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset22RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 23
                        Pset23XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset23YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset23ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset23RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 24
                        Pset24XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset24YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset24ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset24RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 25
                        Pset25XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset25YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset25ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset25RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 26
                        Pset26XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset26YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset26ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset26RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 27
                        Pset27XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset27YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset27ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset27RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 28
                        Pset28XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset28YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset28ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset28RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 29
                        Pset29XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset29YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset29ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset29RPosCompensate.Text = Pset(i).RPosCompensate
                    Case 30
                        Pset30XPosCompensate.Text = Pset(i).XPosCompensate
                        Pset30YPosCompensate.Text = Pset(i).YPosCompensate
                        Pset30ZPosCompensate.Text = Pset(i).ZPosCompensate
                        Pset30RPosCompensate.Text = Pset(i).RPosCompensate

                End Select
            Next
        Else

        End If

        If NumberOfSet > 0 Then
            For i As Integer = 0 To NumberOfSet - 1
                Select Case i + 1
                    Case 1
                        MES_Enabled.Checked = newset(i)
                    Case 2
                        RePick.Checked = newset(i)
                    Case 3
                        Master.Checked = newset(i)
                    Case 4
                        Slave1.Checked = newset(i)
                    Case 5
                        Slave2.Checked = newset(i)
                    Case 6
                        Slave3.Checked = newset(i)
                    Case 7
                        Clear.Checked = newset(i)
                    Case 8
                        IOTEnable.Checked = newset(i)
                    Case 9
                        CheckBox_CCD.Checked = newset(i)
                End Select
            Next
        End If

        '锁付
        Try
            TextBox_KeyPart.Text = KeyPartPassTXT.Split("$")(0)
            TextBox_passScrewNO.Text = KeyPartPassTXT.Split("$")(1)
        Catch ex As Exception

        End Try
    End Sub

    Private Sub Save_Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Save_Btn.Click
        Try
            Dim filepath = gProDataPath & "\" & chanpin_TextBox.Text & "\"
            Dim PSetfile_num As Integer = FreeFile()
            Dim Getfile_num As Integer = FreeFile()
            Dim Setfile_num As Integer = FreeFile()
            Dim Robot_Or_Access As Integer = FreeFile()
            Dim Para_num As Integer = FreeFile()
            Dim PsetCompensate As PsetSetting
            Dim OpenPsetsetting As Boolean = Exists(filepath & "Psetsetting.txt")
            Dim OpenParameter As Boolean = Exists(filepath & "Parameter.txt")

            Dim GunAnle As Boolean = Exists(filepath & "\GunAnle.txt")

            ''保存Z相检测设定
            'Save_ZaxisPls()
            '保存螺丝参数
            If No_online.Checked = True Then                 '单独不联机
                CurScrewPara.Online_Mod = 1
            ElseIf First_online.Checked = True Then          '联机第一台
                CurScrewPara.Online_Mod = 2
            ElseIf Mid_online.Checked = True Then            '联机中间一台
                CurScrewPara.Online_Mod = 3
            ElseIf End_online.Checked = True Then            '联机最后一台
                CurScrewPara.Online_Mod = 4
            End If

            CurScrewPara.PointCount = Val(TextBox_PointCount.Text)
            CurScrewPara.ScrewSN = TextBox_ScrewSN.Text

            FileOpen(Para_num, filepath & "Parameter.txt", OpenMode.Random)
            FilePut(Para_num, CurScrewPara)
            FileClose(Para_num)
            FrmMain.TextBox_CurScrewSN.Text = CurScrewPara.ScrewSN
            '保存点位参数
            FileOpen(PSetfile_num, filepath & "Psetsetting.txt", OpenMode.Random)

            '取料点保存
            PsetCompensate.XPosCompensate = Val(Pset1XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset1YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset1ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset1RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(0) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset2XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset2YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset2ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset2RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(1) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset3XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset3YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset3ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset3RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(2) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset4XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset4YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset4ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset4RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(3) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset5XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset5YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset5ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset5RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(4) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset6XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset6YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset6ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset6RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(5) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset7XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset7YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset7ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset7RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(6) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset8XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset8YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset8ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset8RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(7) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset9XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset9YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset9ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset9RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(8) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset10XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset10YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset10ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset10RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(9) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset11XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset11YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset11ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset11RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(10) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset12XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset12YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset12ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset12RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(11) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset13XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset13YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset13ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset13RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(12) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset14XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset14YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset14ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset14RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(13) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset15XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset15YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset15ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset15RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(14) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset16XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset16YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset16ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset16RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(15) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset17XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset17YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset17ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset17RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(16) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset18XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset18YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset18ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset18RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(17) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset19XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset19YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset19ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset19RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(18) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset20XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset20YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset20ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset20RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(19) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset21XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset21YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset21ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset21RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(20) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset22XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset22YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset22ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset22RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(21) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset23XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset23YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset23ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset23RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(22) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset24XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset24YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset24ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset24RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(23) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset25XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset25YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset25ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset25RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(24) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset26XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset26YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset26ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset26RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(25) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset27XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset27YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset27ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset27RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(26) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset28XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset28YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset28ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset28RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(27) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset29XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset29YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset29ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset29RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(28) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(Pset30XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pset30YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pset30ZPosCompensate.Text)
            PsetCompensate.RPosCompensate = Val(Pset30RPosCompensate.Text)
            FilePut(PSetfile_num, PsetCompensate)
            Pset(29) = PsetCompensate

            FileClose(PSetfile_num)

            'Robot_Or_Access
            FileOpen(Robot_Or_Access, gProDataPath & "\" & "Robot_Or_Access.txt", OpenMode.Random)
            Upload_enable = Val(SNMN.Checked) '联机Enable
            FilePut(Robot_Or_Access, Upload_enable)
            FileClose(Robot_Or_Access)

            'If Upload_enable = True Then
            '    FrmMain.InitTcpSever2()
            'End If

            'Get
            FileOpen(Getfile_num, gProDataPath & "\" & "Get.txt", OpenMode.Random)
            PsetCompensate.XPosCompensate = Val(Pget1XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pget1YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pget1ZPosCompensate.Text)
            FilePut(Getfile_num, PsetCompensate)
            Pget(0) = PsetCompensate
            PsetCompensate.XPosCompensate = Val(Pget2XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pget2YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pget2ZPosCompensate.Text)
            FilePut(Getfile_num, PsetCompensate)
            Pget(1) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(XMin.Text)
            PsetCompensate.YPosCompensate = Val(XMax.Text)
            PsetCompensate.ZPosCompensate = Val(Lenth.Text)
            FilePut(Getfile_num, PsetCompensate)
            Pget(2) = PsetCompensate

            PsetCompensate.XPosCompensate = Val(ADD_Screw_Count_Box.Text)
            PsetCompensate.YPosCompensate = Val(Retry_Times_box.Text)
            PsetCompensate.ZPosCompensate = Val(Clear_Time_Box.Text)
            FilePut(Getfile_num, PsetCompensate)
            Pget(3) = PsetCompensate

            ADD_Screw_Count = Pget(3).XPosCompensate
            Retry_Times = Pget(3).YPosCompensate
            Clear_Time = Pget(3).ZPosCompensate

            PsetCompensate.XPosCompensate = Val(Pget3XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pget3YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pget3ZPosCompensate.Text)
            FilePut(Getfile_num, PsetCompensate)
            Pget(4) = PsetCompensate
            PsetCompensate.XPosCompensate = Val(Pget4XPosCompensate.Text)
            PsetCompensate.YPosCompensate = Val(Pget4YPosCompensate.Text)
            PsetCompensate.ZPosCompensate = Val(Pget4ZPosCompensate.Text)
            FilePut(Getfile_num, PsetCompensate)
            Pget(5) = PsetCompensate

            PsetCompensate.YPosCompensate = Val(Photo_displacement.Text)
            PsetCompensate.ZPosCompensate = Val(UploadDataNum.Text)

            FilePut(Getfile_num, PsetCompensate)
            Pget(6) = PsetCompensate

            FileClose(Getfile_num)

            ' set
            FileOpen(Setfile_num, gProDataPath & "\" & "Set.txt", OpenMode.Random)

            newset(0) = MES_Enabled.Checked        'MES访问                                       'MES数据上传
            FilePut(Setfile_num, newset(0))

            newset(1) = RePick.Checked                                               '直接打下一颗
            FilePut(Setfile_num, newset(1))

            newset(2) = Master.Checked
            FilePut(Setfile_num, newset(2))

            newset(3) = Slave1.Checked
            FilePut(Setfile_num, newset(3))

            newset(4) = Slave2.Checked
            FilePut(Setfile_num, newset(4))

            newset(5) = Slave3.Checked
            FilePut(Setfile_num, newset(5))

            newset(6) = Clear.Checked                                                '整点清理数据
            FilePut(Setfile_num, newset(6))

            newset(7) = IOTEnable.Checked     'IOT上传                                    '设备数据上传
            FilePut(Setfile_num, newset(7))

            newset(8) = CheckBox_CCD.Checked  '扫码切换机型                                   'CCD扫码
            FilePut(Setfile_num, newset(8))

            'UploadDataNum

            FileClose(Setfile_num)

            '螺丝点参数保存至数据库
            If newset(7) = False Then
                FrmMain.CloseUploadProcess()
            End If

            '螺丝点参数保存至数据库
            SavePointPara()
            SavePointWay() '斜锁参数
            '保存特殊料漏锁
            Dim KeyPassfile_num As Integer = FreeFile()
            Dim KeyPartPass As Boolean = Exists(filepath & "\KeyPartPass.txt")
            FileOpen(KeyPassfile_num, filepath & "\KeyPartPass.txt", OpenMode.Random)
            KeyPartPassTXT = TextBox_KeyPart.Text & "$" & TextBox_passScrewNO.Text & "$"
            Try
                Dim ss() As String = TextBox_passScrewNO.Text.Split(",")
                For i As Integer = 0 To unLockNO.Length - 1
                    unLockNO(i) = 0
                    If i < ss.Length Then
                        If ss(i) <> "" Then
                            unLockNO(i) = ss(i)
                        End If
                    End If
                Next
            Catch ex As Exception

            End Try
            FilePut(KeyPassfile_num, KeyPartPassTXT)
            FileClose(KeyPassfile_num)
            MsgBox("保存成功！")
            FrmMain.OPC_RefreshData_Parameter()
        Catch ex As Exception
            MsgBox("Save_Btn_Click" & ex.Message.ToString & ex.StackTrace.ToString)
        End Try
    End Sub

    Private Sub Save_ZaxisPls()

        Dim filepath = gProDataPath & "\" & FrmMain.TCmbPro.Text & "\"
        Dim Zcheckpls_num As Integer = FreeFile()
        Dim OpenZpls As Boolean = Exists(filepath & "ZaxisCheck.txt")
        Dim s As String = ""
        Try

            FileOpen(Zcheckpls_num, filepath & "ZaxisCheck.txt", OpenMode.Random)

            'ZaxisPls(0) = Val(0)
            'ZaxisPls(1) = Val(TextBox_Zpls1.Text)
            'ZaxisPls(2) = Val(TextBox_Zpls2.Text)
            'ZaxisPls(3) = Val(TextBox_Zpls3.Text)
            'ZaxisPls(4) = Val(TextBox_Zpls4.Text)
            'ZaxisPls(5) = Val(TextBox_Zpls5.Text)
            'ZaxisPls(6) = Val(TextBox_Zpls6.Text)
            'ZaxisPls(7) = Val(TextBox_Zpls7.Text)
            'ZaxisPls(8) = Val(TextBox_Zpls8.Text)
            'ZaxisPls(9) = Val(TextBox_Zpls9.Text)
            'ZaxisPls(10) = Val(TextBox_Zpls10.Text)
            'ZaxisPls(11) = Val(TextBox_Zpls11.Text)
            'ZaxisPls(12) = Val(TextBox_Zpls12.Text)
            'ZaxisPls(13) = Val(TextBox_Zpls13.Text)
            'ZaxisPls(14) = Val(TextBox_Zpls14.Text)
            'ZaxisPls(15) = Val(TextBox_Zpls15.Text)
            'ZaxisPls(16) = Val(TextBox_Zpls16.Text)
            'ZaxisPls(17) = Val(TextBox_Zpls17.Text)
            'ZaxisPls(18) = Val(TextBox_Zpls18.Text)
            'ZaxisPls(19) = Val(TextBox_Zpls19.Text)
            'ZaxisPls(20) = Val(TextBox_Zpls20.Text)
            'ZaxisPls(21) = Val(TextBox_Zpls21.Text)
            'ZaxisPls(22) = Val(TextBox_Zpls22.Text)
            'ZaxisPls(23) = Val(TextBox_Zpls23.Text)
            'ZaxisPls(24) = Val(TextBox_Zpls24.Text)
            'ZaxisPls(25) = Val(TextBox_Zpls25.Text)
            'ZaxisPls(26) = Val(TextBox_Zpls26.Text)
            'ZaxisPls(27) = Val(TextBox_Zpls27.Text)
            'ZaxisPls(28) = Val(TextBox_Zpls28.Text)
            'ZaxisPls(29) = Val(TextBox_Zpls29.Text)
            'ZaxisPls(30) = Val(TextBox_Zpls30.Text)

            'ZaxisCheckUSE = ZaxisCheck.Checked
            Dim i As Integer
            For i = 0 To ZaxisPls.Length - 1
                s += ZaxisPls(i).ToString & ","
            Next
            's += ZaxisCheckUSE.ToString
            FilePut(Zcheckpls_num, s)
            FileClose(Zcheckpls_num)
        Catch ex As Exception
            MsgBox("Save_ZaxisPls()" & ex.Message.ToString & ex.StackTrace.ToString)
        End Try
    End Sub

    Private Sub Load_ZaxisPls()
        Dim filepath = gProDataPath & "\" & FrmMain.TCmbPro.Text & "\"
        Dim Zcheckpls_num As Integer = FreeFile()
        Dim OpenZpls As Boolean = Exists(filepath & "ZaxisCheck.txt")
        Dim s As String = ""
        Dim ss() As String
        Try

            If OpenZpls = True Then
                FileOpen(Zcheckpls_num, filepath & "ZaxisCheck.txt", OpenMode.Random)
                FileGet(Zcheckpls_num, s)
                ss = Split(s, ",")

                'TextBox_ZplsRange.Text = ss(0)
                'TextBox_Zpls1.Text = ss(1)
                'TextBox_Zpls2.Text = ss(2)
                'TextBox_Zpls3.Text = ss(3)
                'TextBox_Zpls4.Text = ss(4)
                'TextBox_Zpls5.Text = ss(5)
                'TextBox_Zpls6.Text = ss(6)
                'TextBox_Zpls7.Text = ss(7)
                'TextBox_Zpls8.Text = ss(8)
                'TextBox_Zpls9.Text = ss(9)
                'TextBox_Zpls10.Text = ss(10)
                'TextBox_Zpls11.Text = ss(11)
                'TextBox_Zpls12.Text = ss(12)
                'TextBox_Zpls13.Text = ss(13)
                'TextBox_Zpls14.Text = ss(14)
                'TextBox_Zpls15.Text = ss(15)

                'TextBox_Zpls16.Text = ss(16)
                'TextBox_Zpls17.Text = ss(17)
                'TextBox_Zpls18.Text = ss(18)
                'TextBox_Zpls19.Text = ss(19)
                'TextBox_Zpls20.Text = ss(20)
                'TextBox_Zpls21.Text = ss(21)
                'TextBox_Zpls22.Text = ss(22)
                'TextBox_Zpls23.Text = ss(23)
                'TextBox_Zpls24.Text = ss(24)
                'TextBox_Zpls25.Text = ss(25)
                'TextBox_Zpls26.Text = ss(26)
                'TextBox_Zpls27.Text = ss(27)
                'TextBox_Zpls28.Text = ss(28)
                'TextBox_Zpls29.Text = ss(29)
                'TextBox_Zpls30.Text = ss(30)
                Dim i As Integer
                For i = 0 To 30
                    ZaxisPls(i) = Val(ss(i))
                Next

                FileClose(Zcheckpls_num)
            Else
                'TextBox_ZplsRange.Text = 0
                'TextBox_Zpls1.Text = 0
                'TextBox_Zpls2.Text = 0
                'TextBox_Zpls3.Text = 0
                'TextBox_Zpls4.Text = 0
                'TextBox_Zpls5.Text = 0
                'TextBox_Zpls6.Text = 0
                'TextBox_Zpls7.Text = 0
                'TextBox_Zpls8.Text = 0
                'TextBox_Zpls9.Text = 0
                'TextBox_Zpls10.Text = 0
                'TextBox_Zpls11.Text = 0
                'TextBox_Zpls12.Text = 0
                'TextBox_Zpls13.Text = 0
                'TextBox_Zpls14.Text = 0
                'TextBox_Zpls15.Text = 0
                'TextBox_Zpls16.Text = 0
                'TextBox_Zpls17.Text = 0
                'TextBox_Zpls19.Text = 0
                'TextBox_Zpls20.Text = 0
                'TextBox_Zpls21.Text = 0
                'TextBox_Zpls22.Text = 0
                'TextBox_Zpls24.Text = 0
                'TextBox_Zpls25.Text = 0
                'TextBox_Zpls26.Text = 0
                'TextBox_Zpls27.Text = 0
                'TextBox_Zpls28.Text = 0
                'TextBox_Zpls29.Text = 0
                'TextBox_Zpls30.Text = 0

                For i = 0 To 30
                    ZaxisPls(i) = 0
                Next

            End If
        Catch ex As Exception
            MsgBox("Load_ZaxisPls()" & ex.Message.ToString & ex.StackTrace.ToString)
        End Try
    End Sub

    Private Sub SavePointPara()
        Dim i As Integer = 0
        Try
            'Dim sql1 As String = ""
            'Dim DBpath As AccessHelper = New AccessHelper("Tool\" & Chanpin & "\PointPara.accdb")
            'For i = 1 To 30
            '    If i < 10 Then
            '        sql1 = " update " & " PointPara " & "set torque=" & TextBox_Torq(i).Text & ",angle=" & TextBox_Angle(i).Text & ",feeder=" & TextBox_feeder(i).Text & ",disable=" & Checkbox_Disable(i).Checked.ToString & " where PointName=" & "'set0" & i & "'"
            '    Else
            '        sql1 = " update " & " PointPara " & "set torque=" & TextBox_Torq(i).Text & ",angle=" & TextBox_Angle(i).Text & ",feeder=" & TextBox_feeder(i).Text & ",disable=" & Checkbox_Disable(i).Checked.ToString & " where PointName=" & "'set" & i & "'"
            '    End If
            '    DBpath.HandleAccess(sql1)
            'Next

            'For i = 1 To 30
            '    PointPara(i).torque = TextBox_Torq(i).Text
            '    PointPara(i).angle = TextBox_Angle(i).Text
            '    PointPara(i).feeder = TextBox_feeder(i).Text
            '    PointPara(i).diable = Checkbox_Disable(i).Checked
            '    ' PointPara(i).Round_num = Checkbox_Round(i).Checked
            'Next
            Dim Sql1 As String
            For i = 1 To 30
                If i < 10 Then
                    Sql1 = " update " & " PointPara " & "set torque=" & TextBox_Torq(i).Text & ",angle=" & TextBox_Angle(i).Text & ",feeder=" & TextBox_feeder(i).Text & ",disable=" & Checkbox_Disable(i).Checked.ToString & " where PointName=" & "'set0" & i & "'and Product='" & Chanpin & "'"
                    HandleMysql(Sql1)
                Else
                    Sql1 = " update " & " PointPara " & "set torque=" & TextBox_Torq(i).Text & ",angle=" & TextBox_Angle(i).Text & ",feeder=" & TextBox_feeder(i).Text & ",disable=" & Checkbox_Disable(i).Checked.ToString & " where PointName=" & "'set" & i & "'and Product='" & Chanpin & "'"
                    HandleMysql(Sql1)
                End If

            Next
            For i = 1 To 30
                PointPara(i).torque = TextBox_Torq(i).Text
                PointPara(i).angle = TextBox_Angle(i).Text
                PointPara(i).feeder = TextBox_feeder(i).Text
                PointPara(i).diable = Checkbox_Disable(i).Checked
            Next
        Catch ex As Exception
            MsgBox("SavePointPara err:" & ex.Message.ToString)
        End Try
    End Sub

    Private Sub SavePointWay()
        Dim i As Integer = 0
        Try
            Dim sql1 As String = ""
            For i = 1 To 30
                If i < 10 Then
                    sql1 = " update " & " pointpara " & "set Way=" & ComBox_XFS(i).SelectedIndex & ",High=" & TextBox_High(i).Text & ",X轴角度=" & TextBox_X轴(i).Text & ",Y轴角度=" & TextBox_Y轴(i).Text & " where PointName=" & "'set0" & i & "' and Product='" & FrmMain.TCmbPro.Text & "'"
                Else
                    sql1 = " update " & " pointpara " & "set Way=" & ComBox_XFS(i).SelectedIndex & ",High=" & TextBox_High(i).Text & ",X轴角度=" & TextBox_X轴(i).Text & ",Y轴角度=" & TextBox_Y轴(i).Text & " where PointName=" & "'set" & i & "' and Product='" & FrmMain.TCmbPro.Text & "'"
                End If
                'HandleDB(sql1, cnStr)
                HandleMysql(sql1)
            Next

            For i = 1 To 30
                PointWay(i) = ComBox_XFS(i).SelectedIndex
                PointHigh(i) = TextBox_High(i).Text
                Point_X轴C(i) = TextBox_X轴(i).Text
                Point_Y轴C(i) = TextBox_Y轴(i).Text
            Next
        Catch ex As Exception
            MsgBox("SavePointPara err:" & ex.Message.ToString)
        End Try
    End Sub

    ''' <summary>
    ''' 将控件存入数组
    ''' </summary>
    ''' <remarks></remarks>
    Private Sub initControl()

        Try
            '禁用按钮组
            Checkbox_Disable(1) = CheckBox_disable1
            Checkbox_Disable(2) = CheckBox_disable2
            Checkbox_Disable(3) = CheckBox_disable3
            Checkbox_Disable(4) = CheckBox_disable4
            Checkbox_Disable(5) = CheckBox_disable5
            Checkbox_Disable(6) = CheckBox_disable6
            Checkbox_Disable(7) = CheckBox_disable7
            Checkbox_Disable(8) = CheckBox_disable8
            Checkbox_Disable(9) = CheckBox_disable9
            Checkbox_Disable(10) = CheckBox_disable10
            Checkbox_Disable(11) = CheckBox_disable11
            Checkbox_Disable(12) = CheckBox_disable12
            Checkbox_Disable(13) = CheckBox_disable13
            Checkbox_Disable(14) = CheckBox_disable14
            Checkbox_Disable(15) = CheckBox_disable15
            Checkbox_Disable(16) = CheckBox_disable16
            Checkbox_Disable(17) = CheckBox_disable17
            Checkbox_Disable(18) = CheckBox_disable18
            Checkbox_Disable(19) = CheckBox_disable19
            Checkbox_Disable(20) = CheckBox_disable20
            Checkbox_Disable(21) = CheckBox_disable21
            Checkbox_Disable(22) = CheckBox_disable22
            Checkbox_Disable(23) = CheckBox_disable23
            Checkbox_Disable(24) = CheckBox_disable24
            Checkbox_Disable(25) = CheckBox_disable25
            Checkbox_Disable(26) = CheckBox_disable26
            Checkbox_Disable(27) = CheckBox_disable27
            Checkbox_Disable(28) = CheckBox_disable28
            Checkbox_Disable(29) = CheckBox_disable29
            Checkbox_Disable(30) = CheckBox_disable30

            '扭力设置组
            TextBox_Torq(1) = TextBox_Torq1
            TextBox_Torq(2) = TextBox_Torq2
            TextBox_Torq(3) = TextBox_Torq3
            TextBox_Torq(4) = TextBox_Torq4
            TextBox_Torq(5) = TextBox_Torq5
            TextBox_Torq(6) = TextBox_Torq6
            TextBox_Torq(7) = TextBox_Torq7
            TextBox_Torq(8) = TextBox_Torq8
            TextBox_Torq(9) = TextBox_Torq9
            TextBox_Torq(10) = TextBox_Torq10
            TextBox_Torq(11) = TextBox_Torq11
            TextBox_Torq(12) = TextBox_Torq12
            TextBox_Torq(13) = TextBox_Torq13
            TextBox_Torq(14) = TextBox_Torq14
            TextBox_Torq(15) = TextBox_Torq15
            TextBox_Torq(16) = TextBox_Torq16
            TextBox_Torq(17) = TextBox_Torq17
            TextBox_Torq(18) = TextBox_Torq18
            TextBox_Torq(19) = TextBox_Torq19
            TextBox_Torq(20) = TextBox_Torq20
            TextBox_Torq(21) = TextBox_Torq21
            TextBox_Torq(22) = TextBox_Torq22
            TextBox_Torq(23) = TextBox_Torq23
            TextBox_Torq(24) = TextBox_Torq24
            TextBox_Torq(25) = TextBox_Torq25
            TextBox_Torq(26) = TextBox_Torq26
            TextBox_Torq(27) = TextBox_Torq27
            TextBox_Torq(28) = TextBox_Torq28
            TextBox_Torq(29) = TextBox_Torq29
            TextBox_Torq(30) = TextBox_Torq30

            '角度设置组
            TextBox_Angle(1) = TextBox_Angle1
            TextBox_Angle(2) = TextBox_Angle2
            TextBox_Angle(3) = TextBox_Angle3
            TextBox_Angle(4) = TextBox_Angle4
            TextBox_Angle(5) = TextBox_Angle5
            TextBox_Angle(6) = TextBox_Angle6
            TextBox_Angle(7) = TextBox_Angle7
            TextBox_Angle(8) = TextBox_Angle8
            TextBox_Angle(9) = TextBox_Angle9
            TextBox_Angle(10) = TextBox_Angle10
            TextBox_Angle(11) = TextBox_Angle11
            TextBox_Angle(12) = TextBox_Angle12
            TextBox_Angle(13) = TextBox_Angle13
            TextBox_Angle(14) = TextBox_Angle14
            TextBox_Angle(15) = TextBox_Angle15
            TextBox_Angle(16) = TextBox_Angle16
            TextBox_Angle(17) = TextBox_Angle17
            TextBox_Angle(18) = TextBox_Angle18
            TextBox_Angle(19) = TextBox_Angle19
            TextBox_Angle(20) = TextBox_Angle20
            TextBox_Angle(21) = TextBox_Angle21
            TextBox_Angle(22) = TextBox_Angle22
            TextBox_Angle(23) = TextBox_Angle23
            TextBox_Angle(24) = TextBox_Angle24
            TextBox_Angle(25) = TextBox_Angle25
            TextBox_Angle(26) = TextBox_Angle26
            TextBox_Angle(27) = TextBox_Angle27
            TextBox_Angle(28) = TextBox_Angle28
            TextBox_Angle(29) = TextBox_Angle29
            TextBox_Angle(30) = TextBox_Angle30

            '供料器设置组
            TextBox_feeder(1) = TextBox_feeder1
            TextBox_feeder(2) = TextBox_feeder2
            TextBox_feeder(3) = TextBox_feeder3
            TextBox_feeder(4) = TextBox_feeder4
            TextBox_feeder(5) = TextBox_feeder5
            TextBox_feeder(6) = TextBox_feeder6
            TextBox_feeder(7) = TextBox_feeder7
            TextBox_feeder(8) = TextBox_feeder8
            TextBox_feeder(9) = TextBox_feeder9
            TextBox_feeder(10) = TextBox_feeder10
            TextBox_feeder(11) = TextBox_feeder11
            TextBox_feeder(12) = TextBox_feeder12
            TextBox_feeder(13) = TextBox_feeder13
            TextBox_feeder(14) = TextBox_feeder14
            TextBox_feeder(15) = TextBox_feeder15
            TextBox_feeder(16) = TextBox_feeder16
            TextBox_feeder(17) = TextBox_feeder17
            TextBox_feeder(18) = TextBox_feeder18
            TextBox_feeder(19) = TextBox_feeder19
            TextBox_feeder(20) = TextBox_feeder20
            TextBox_feeder(21) = TextBox_feeder21
            TextBox_feeder(22) = TextBox_feeder22
            TextBox_feeder(23) = TextBox_feeder23
            TextBox_feeder(24) = TextBox_feeder24
            TextBox_feeder(25) = TextBox_feeder25
            TextBox_feeder(26) = TextBox_feeder26
            TextBox_feeder(27) = TextBox_feeder27
            TextBox_feeder(28) = TextBox_feeder28
            TextBox_feeder(29) = TextBox_feeder29
            TextBox_feeder(30) = TextBox_feeder30

            ''圈数设置组
            'Checkbox_Round(1) = CheckBox1
            'Checkbox_Round(2) = CheckBox2
            'Checkbox_Round(3) = CheckBox3
            'Checkbox_Round(4) = CheckBox4
            'Checkbox_Round(5) = CheckBox5
            'Checkbox_Round(6) = CheckBox6
            'Checkbox_Round(7) = CheckBox7
            'Checkbox_Round(8) = CheckBox8
            'Checkbox_Round(9) = CheckBox9
            'Checkbox_Round(10) = CheckBox10
            'Checkbox_Round(11) = CheckBox11
            'Checkbox_Round(12) = CheckBox12
            'Checkbox_Round(13) = CheckBox13
            'Checkbox_Round(14) = CheckBox14
            'Checkbox_Round(15) = CheckBox15
            '斜锁锁付方式
            ComBox_XFS(1) = ComboBox1
            ComBox_XFS(2) = ComboBox2
            ComBox_XFS(3) = ComboBox3
            ComBox_XFS(4) = ComboBox4
            ComBox_XFS(5) = ComboBox5
            ComBox_XFS(6) = ComboBox6
            ComBox_XFS(7) = ComboBox7
            ComBox_XFS(8) = ComboBox8
            ComBox_XFS(9) = ComboBox9
            ComBox_XFS(10) = ComboBox10
            ComBox_XFS(11) = ComboBox11
            ComBox_XFS(12) = ComboBox12
            ComBox_XFS(13) = ComboBox13
            ComBox_XFS(14) = ComboBox14
            ComBox_XFS(15) = ComboBox15
            ComBox_XFS(16) = ComboBox16
            ComBox_XFS(17) = ComboBox17
            ComBox_XFS(18) = ComboBox18
            ComBox_XFS(19) = ComboBox19
            ComBox_XFS(20) = ComboBox20
            ComBox_XFS(21) = ComboBox21
            ComBox_XFS(22) = ComboBox22
            ComBox_XFS(23) = ComboBox23
            ComBox_XFS(24) = ComboBox24
            ComBox_XFS(25) = ComboBox25
            ComBox_XFS(26) = ComboBox26
            ComBox_XFS(27) = ComboBox27
            ComBox_XFS(28) = ComboBox28
            ComBox_XFS(29) = ComboBox29
            ComBox_XFS(30) = ComboBox30
            '高度数据
            TextBox_High(1) = TextBox1_Thigh
            TextBox_High(2) = TextBox2_Thigh
            TextBox_High(3) = TextBox3_Thigh
            TextBox_High(4) = TextBox4_Thigh
            TextBox_High(5) = TextBox5_Thigh
            TextBox_High(6) = TextBox6_Thigh
            TextBox_High(7) = TextBox7_Thigh
            TextBox_High(8) = TextBox8_Thigh
            TextBox_High(9) = TextBox9_Thigh
            TextBox_High(10) = TextBox10_Thigh
            TextBox_High(11) = TextBox11_Thigh
            TextBox_High(12) = TextBox12_Thigh
            TextBox_High(13) = TextBox13_Thigh
            TextBox_High(14) = TextBox14_Thigh
            TextBox_High(15) = TextBox15_Thigh
            TextBox_High(16) = TextBox16_Thigh
            TextBox_High(17) = TextBox17_Thigh
            TextBox_High(18) = TextBox18_Thigh
            TextBox_High(19) = TextBox19_Thigh
            TextBox_High(20) = TextBox20_Thigh
            TextBox_High(21) = TextBox21_Thigh
            TextBox_High(22) = TextBox22_Thigh
            TextBox_High(23) = TextBox23_Thigh
            TextBox_High(24) = TextBox24_Thigh
            TextBox_High(25) = TextBox25_Thigh
            TextBox_High(26) = TextBox26_Thigh
            TextBox_High(27) = TextBox27_Thigh
            TextBox_High(28) = TextBox28_Thigh
            TextBox_High(29) = TextBox29_Thigh
            TextBox_High(30) = TextBox30_Thigh
            'X轴角度
            TextBox_X轴(1) = TextBox1_XZJD
            TextBox_X轴(2) = TextBox2_XZJD
            TextBox_X轴(3) = TextBox3_XZJD
            TextBox_X轴(4) = TextBox4_XZJD
            TextBox_X轴(5) = TextBox5_XZJD
            TextBox_X轴(6) = TextBox6_XZJD
            TextBox_X轴(7) = TextBox7_XZJD
            TextBox_X轴(8) = TextBox8_XZJD
            TextBox_X轴(9) = TextBox9_XZJD
            TextBox_X轴(10) = TextBox10_XZJD
            TextBox_X轴(11) = TextBox11_XZJD
            TextBox_X轴(12) = TextBox12_XZJD
            TextBox_X轴(13) = TextBox13_XZJD
            TextBox_X轴(14) = TextBox14_XZJD
            TextBox_X轴(15) = TextBox15_XZJD
            TextBox_X轴(16) = TextBox16_XZJD
            TextBox_X轴(17) = TextBox17_XZJD
            TextBox_X轴(18) = TextBox18_XZJD
            TextBox_X轴(19) = TextBox19_XZJD
            TextBox_X轴(20) = TextBox20_XZJD
            TextBox_X轴(21) = TextBox21_XZJD
            TextBox_X轴(22) = TextBox22_XZJD
            TextBox_X轴(23) = TextBox23_XZJD
            TextBox_X轴(24) = TextBox24_XZJD
            TextBox_X轴(25) = TextBox25_XZJD
            TextBox_X轴(26) = TextBox26_XZJD
            TextBox_X轴(27) = TextBox27_XZJD
            TextBox_X轴(28) = TextBox28_XZJD
            TextBox_X轴(29) = TextBox29_XZJD
            TextBox_X轴(30) = TextBox30_XZJD
            'Y轴角度
            TextBox_Y轴(1) = TextBox1_YZJD
            TextBox_Y轴(2) = TextBox2_YZJD
            TextBox_Y轴(3) = TextBox3_YZJD
            TextBox_Y轴(4) = TextBox4_YZJD
            TextBox_Y轴(5) = TextBox5_YZJD
            TextBox_Y轴(6) = TextBox6_YZJD
            TextBox_Y轴(7) = TextBox7_YZJD
            TextBox_Y轴(8) = TextBox8_YZJD
            TextBox_Y轴(9) = TextBox9_YZJD
            TextBox_Y轴(10) = TextBox10_YZJD
            TextBox_Y轴(11) = TextBox11_YZJD
            TextBox_Y轴(12) = TextBox12_YZJD
            TextBox_Y轴(13) = TextBox13_YZJD
            TextBox_Y轴(14) = TextBox14_YZJD
            TextBox_Y轴(15) = TextBox15_YZJD
            TextBox_Y轴(16) = TextBox16_YZJD
            TextBox_Y轴(17) = TextBox17_YZJD
            TextBox_Y轴(18) = TextBox18_YZJD
            TextBox_Y轴(19) = TextBox19_YZJD
            TextBox_Y轴(20) = TextBox20_YZJD
            TextBox_Y轴(21) = TextBox21_YZJD
            TextBox_Y轴(22) = TextBox22_YZJD
            TextBox_Y轴(23) = TextBox23_YZJD
            TextBox_Y轴(24) = TextBox24_YZJD
            TextBox_Y轴(25) = TextBox25_YZJD
            TextBox_Y轴(26) = TextBox26_YZJD
            TextBox_Y轴(27) = TextBox27_YZJD
            TextBox_Y轴(28) = TextBox28_YZJD
            TextBox_Y轴(29) = TextBox29_YZJD
            TextBox_Y轴(30) = TextBox30_YZJD
            For i = 1 To 30
                TextBox_Torq(i).Text = PointPara(i).torque
                TextBox_Angle(i).Text = PointPara(i).angle
                TextBox_feeder(i).Text = PointPara(i).feeder
                Checkbox_Disable(i).Checked = PointPara(i).diable
                ' Checkbox_Round(i).Checked = PointPara(i).Round_num

                ComBox_XFS(i).SelectedIndex = PointWay(i)
                TextBox_High(i).Text = PointHigh(i)
                TextBox_X轴(i).Text = Point_X轴C(i)
                TextBox_Y轴(i).Text = Point_Y轴C(i)
            Next
        Catch ex As Exception
            MsgBox("initControl()" & ex.Message.ToString & ex.StackTrace.ToString)

        End Try
    End Sub

End Class